<?php
require_once ($_SERVER['DOCUMENT_ROOT'].'/conf/global.config.php');
require_once (SRC_DIR.'util.php');

$urldata = urldecode($_SERVER['QUERY_STRING']);

$pos = strpos($urldata, '{');
if ($pos)
{
    $urldata =  substr($urldata,0,$pos);//客户端请求带arg格式，去掉后面的json  plat=android{"server_id"："1"}
}

parse_str($urldata, $data);
if (!isset($data['uid'],$data['amount'],$data['orderid'],$data['server_id'], $data['count'], $data['token']))
{
  ExitAndLog("-1");
}

//$rate = 500;//元宝比例
//if ($data['amount']*$rate != $data['count'])
 //   ExitAndLog("-2");

$check_url = "http://checkuser.sdk.quicksdk.net/v2/checkUserInfo";
$check_param = array(
    "token"  => $data['token'],
    "product_code" => "28158365297530102534440270241624",
    "uid" => $data['uid'],
    "channel_code" => "",
);


if (Util::SendCurlGet($check_url,$check_param)==1)
{
    $result = array(
    "ret" => 0,
    );
    echo json_encode($result);
}
else
{
    ExitAndLog("-3");
}


function ExitAndLog($msg)
{
    global $urldata;
    Util::Logger("urldata:$urldata","quick_pay_verify");
    
    $result = array(
        "ret" => $msg
    );
    exit(json_encode($result));
}